package cn.luischen.service.option.impl;

<<<<<<< HEAD
import org.springframework.cache.annotation.Cacheable;
import cn.luischen.service.option.OptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import cn.luischen.dao.OptionDao;
import cn.luischen.exception.BusinessException;
import cn.luischen.constant.ErrorConstant;
import cn.luischen.model.OptionsDomain;
import org.springframework.transaction.annotation.Transactional;

import org.powermock.reflect.Whitebox;
import org.mockito.Mock;
import static org.junit.Assert.fail;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.ArrayList;
import org.mockito.MockitoAnnotations;
import com.alibaba.fastjson.JSONArray;
import java.util.Map;
import org.junit.After;
import org.powermock.core.classloader.annotations.PrepareForTest;
import static org.junit.Assert.assertEquals;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import java.lang.reflect.Method;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.junit.Test;
import static org.junit.Assert.*;
import com.unitspirit.runtime.*;
import org.mockito.Mockito;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import org.junit.Rule;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import static org.junit.Assert.assertTrue;
import com.alibaba.fastjson.parser.ParserConfig;

/**
* The class <code>OptionServiceImplTest</code> contains tests for the class <code>{@link OptionServiceImpl}</code>.
* Copyright (c) 2020
* 
* @generatedBy UnitSpirit at 2021-09-07 17:52:03
* @version 1.0.20210903
*/

=======
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.luischen.constant.ErrorConstant;
import cn.luischen.dao.OptionDao;
import cn.luischen.exception.BusinessException;
import cn.luischen.model.OptionsDomain;
import cn.luischen.service.option.OptionService;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
 * The class contains tests for the class cn.luischen.service.option.impl.OptionServiceImpl.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
@PowerMockIgnore({ "javax.management.*" })
@RunWith(PowerMockRunner.class)
@PrepareForTest({ cn.luischen.dao.OptionDao.class })
public class OptionServiceImpl_getOptions_WGTest {
<<<<<<< HEAD

	@InjectMocks
	cn.luischen.service.option.impl.OptionServiceImpl unitspirit_fixture;
	@Mock
	cn.luischen.dao.OptionDao mock_OptionDao;

=======
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
<<<<<<< HEAD
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:52:03
	*/
=======
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-12-06 21:50:31
	 */
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

<<<<<<< HEAD
	/**
	* @date 2021-09-07 17:52:04
	* @see cn.luischen.service.option.impl.OptionServiceImpl#getOptions
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getOptions_0113_190010_763_1_01() throws Throwable {
		//成员变量设置

		//返回值定义 
		String result_expected = "[{\"description\":\"百度网站验证码\",\"name\":\"baidu_site_verification\"},{\"description\":\"google网站验证码\",\"name\":\"google_site_verification\"},{\"description\":\"网站描述\",\"name\":\"site_description\"},{\"name\":\"site_keywords\"},{\"description\":\"备案号\",\"name\":\"site_record\"},{\"description\":\"网站标题\",\"name\":\"site_title\"},{\"description\":\"csdn\",\"name\":\"social_csdn\"},{\"description\":\"github\",\"name\":\"social_github\"},{\"description\":\"简书地址\",\"name\":\"social_jianshu\"},{\"description\":\"简历地址\",\"name\":\"social_resume\"},{\"description\":\"twitter\",\"name\":\"social_twitter\"},{\"description\":\"微博地址\",\"name\":\"social_weibo\"},{\"description\":\"知乎地址\",\"name\":\"social_zhihu\"}]";

		java.util.List<cn.luischen.model.OptionsDomain> mock_result_ArrayList1 = JSON.parseArray(
				"[{\"description\":\"百度网站验证码\",\"name\":\"baidu_site_verification\"},{\"description\":\"google网站验证码\",\"name\":\"google_site_verification\"},{\"description\":\"网站描述\",\"name\":\"site_description\"},{\"name\":\"site_keywords\"},{\"description\":\"备案号\",\"name\":\"site_record\"},{\"description\":\"网站标题\",\"name\":\"site_title\"},{\"description\":\"csdn\",\"name\":\"social_csdn\"},{\"description\":\"github\",\"name\":\"social_github\"},{\"description\":\"简书地址\",\"name\":\"social_jianshu\"},{\"description\":\"简历地址\",\"name\":\"social_resume\"},{\"description\":\"twitter\",\"name\":\"social_twitter\"},{\"description\":\"微博地址\",\"name\":\"social_weibo\"},{\"description\":\"知乎地址\",\"name\":\"social_zhihu\"}]",
				cn.luischen.model.OptionsDomain.class);

		PowerMockito.when(mock_OptionDao.getOptions()).thenReturn(mock_result_ArrayList1);

		java.util.List<cn.luischen.model.OptionsDomain> unitspirit_result = unitspirit_fixture.getOptions();
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:52:04
	* @see cn.luischen.service.option.impl.OptionServiceImpl#getOptions
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getOptions_0113_190010_763_33_01() throws Throwable {
		//成员变量设置

		//返回值定义 
		String result_expected = "[{\"description\":\"百度网站验证码\",\"name\":\"baidu_site_verification\"},{\"description\":\"google网站验证码\",\"name\":\"google_site_verification\"},{\"description\":\"网站描述\",\"name\":\"site_description\"},{\"name\":\"site_keywords\"},{\"description\":\"备案号\",\"name\":\"site_record\"},{\"description\":\"网站标题\",\"name\":\"site_title\"},{\"description\":\"csdn\",\"name\":\"social_csdn\"},{\"description\":\"github\",\"name\":\"social_github\"},{\"description\":\"简书地址\",\"name\":\"social_jianshu\"},{\"description\":\"简历地址\",\"name\":\"social_resume\"},{\"description\":\"twitter\",\"name\":\"social_twitter\"},{\"description\":\"微博地址\",\"name\":\"social_weibo\"},{\"description\":\"知乎地址\",\"name\":\"social_zhihu\"}]";

		java.util.List<cn.luischen.model.OptionsDomain> mock_result_ArrayList1 = JSON.parseArray(
				"[{\"description\":\"百度网站验证码\",\"name\":\"baidu_site_verification\"},{\"description\":\"google网站验证码\",\"name\":\"google_site_verification\"},{\"description\":\"网站描述\",\"name\":\"site_description\"},{\"name\":\"site_keywords\"},{\"description\":\"备案号\",\"name\":\"site_record\"},{\"description\":\"网站标题\",\"name\":\"site_title\"},{\"description\":\"csdn\",\"name\":\"social_csdn\"},{\"description\":\"github\",\"name\":\"social_github\"},{\"description\":\"简书地址\",\"name\":\"social_jianshu\"},{\"description\":\"简历地址\",\"name\":\"social_resume\"},{\"description\":\"twitter\",\"name\":\"social_twitter\"},{\"description\":\"微博地址\",\"name\":\"social_weibo\"},{\"description\":\"知乎地址\",\"name\":\"social_zhihu\"}]",
				cn.luischen.model.OptionsDomain.class);

		PowerMockito.when(mock_OptionDao.getOptions()).thenReturn(mock_result_ArrayList1);

		java.util.List<cn.luischen.model.OptionsDomain> unitspirit_result = unitspirit_fixture.getOptions();
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

=======
	@InjectMocks
	cn.luischen.service.option.impl.OptionServiceImpl unitspirit_fixture;

	@Mock
	cn.luischen.dao.OptionDao mock_OptionDao;

	/**
	 * @date 2021-12-06 21:50:31
	 * @see cn.luischen.service.option.impl.OptionServiceImpl#getOptions
	 * @category null  
	 * @author null  
	 */
	@Test
	public void test_getOptions_20211109_110224_057_1_01() throws Throwable {
		//成员变量设置

		//返回值定义 
		String result_expected = "[{\"name\":\"baidu_site_verification\",\"description\":\"百度网站验证码\",\"value\":\"123\"},{\"name\":\"google_site_verification\",\"description\":\"google网站验证码\",\"value\":\"111\"},{\"name\":\"site_description\",\"description\":\"网站描述\",\"value\":\"erer\"},{\"name\":\"site_keywords\"},{\"name\":\"site_record\",\"description\":\"备案号\",\"value\":\"222\"},{\"name\":\"site_title\",\"description\":\"网站标题\",\"value\":\"11122\"},{\"name\":\"social_csdn\",\"description\":\"csdn\",\"value\":\"111\"},{\"name\":\"social_github\",\"description\":\"github\",\"value\":\"\"},{\"name\":\"social_jianshu\",\"description\":\"简书地址\",\"value\":\"123\"},{\"name\":\"social_resume\",\"description\":\"简历地址\",\"value\":\"\"},{\"name\":\"social_twitter\",\"description\":\"twitter\",\"value\":\"\"},{\"name\":\"social_weibo\",\"description\":\"微博地址\",\"value\":\"333\"},{\"name\":\"social_zhihu\",\"description\":\"知乎地址\",\"value\":\"\"}]";

		java.util.List<cn.luischen.model.OptionsDomain> mock_result_ArrayList1 = JSON
				.parseArray(
						"[{\"name\":\"baidu_site_verification\",\"description\":\"百度网站验证码\",\"value\":\"123\"},{\"name\":\"google_site_verification\",\"description\":\"google网站验证码\",\"value\":\"111\"},{\"name\":\"site_description\",\"description\":\"网站描述\",\"value\":\"erer\"},{\"name\":\"site_keywords\"},{\"name\":\"site_record\",\"description\":\"备案号\",\"value\":\"222\"},{\"name\":\"site_title\",\"description\":\"网站标题\",\"value\":\"11122\"},{\"name\":\"social_csdn\",\"description\":\"csdn\",\"value\":\"111\"},{\"name\":\"social_github\",\"description\":\"github\",\"value\":\"\"},{\"name\":\"social_jianshu\",\"description\":\"简书地址\",\"value\":\"123\"},{\"name\":\"social_resume\",\"description\":\"简历地址\",\"value\":\"\"},{\"name\":\"social_twitter\",\"description\":\"twitter\",\"value\":\"\"},{\"name\":\"social_weibo\",\"description\":\"微博地址\",\"value\":\"333\"},{\"name\":\"social_zhihu\",\"description\":\"知乎地址\",\"value\":\"\"}]",
						cn.luischen.model.OptionsDomain.class);

		PowerMockito.when(mock_OptionDao.getOptions()).thenReturn(
				mock_result_ArrayList1);

		java.util.List<cn.luischen.model.OptionsDomain> unitspirit_result = unitspirit_fixture
				.getOptions();
		java.util.ArrayList obj_expected = JSON.parseObject(result_expected,
				java.util.ArrayList.class);
		UnitAssert.assertEquals(
				UnitSpiritFastJsonUtil.getJsonString2(obj_expected),
				UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
}
